
*********
Objective
*********

Create a simple application that trains and serves a `Sklearn <https://scikit-learn.org/stable/>`_ machine learning model with `MLServer from SeldonIO <https://github.com/SeldonIO/MLServer>`_

----

*****************
Final Application
*****************

Here is a gif of the final application built in this example.

.. figure::  https://pl-public-data.s3.amazonaws.com/assets_lightning/ml_server_2.gif

----

*************
System Design
*************

In order to create such application, we need to build several components:

* A Model Train Component that trains a model and provides its trained weights

* A Model Server Component that serves as an API endpoint for the model generated by the **Model Train Component**.

* A Load Testing Component that tests the model server works as expected. This could be used to CI/CD the performance of newly generated models (left to the users).

.. figure::  https://pl-public-data.s3.amazonaws.com/assets_lightning/model_server_app_2.png

Let's dive into the tutorial.

----

********
Tutorial
********

.. raw:: html

    <div class="display-card-container">
        <div class="row">

.. Add callout items below this line

.. displayitem::
   :header: 1.  Build a Train Component
   :description: Train a model and store its checkpoints with SKlearn
   :col_css: col-md-4
   :button_link: train.html
   :height: 150
   :tag: Intermediate

.. displayitem::
   :header: 2. Build a Model Server Component
   :description: Use MLServer to server your models
   :col_css: col-md-4
   :button_link: model_server.html
   :height: 150
   :tag: Intermediate

.. displayitem::
   :header: 3. Build a Load Testing Component
   :description: Use Locust to test your model servers
   :col_css: col-md-4
   :button_link: load_testing.html
   :height: 150
   :tag: Intermediate

.. displayitem::
   :header: 4. Putting everything together.
   :description: Ensemble the components together and run the app
   :col_css: col-md-4
   :button_link: putting_everything_together.html
   :height: 150
   :tag: basic

.. raw:: html

        </div>
    </div>
